package net.wyf.myaidlserver;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Wyf on 2017/11/29.
 */

public class User implements Parcelable {

    public User() {
    }

    public User(int rCode, String rMessage) {
        this.rMessage = rMessage;
        this.rCode = rCode;
    }

    @Override
    public String toString() {
        return "User{" +
                "rCode=" + rCode +
                ", rMessage='" + rMessage + '\'' +
                '}';
    }

    private String rMessage;
    private int rCode;

    protected User(Parcel in) {
        readFromParcel(in);
    }

    public void readFromParcel(Parcel in) {
        rMessage = in.readString();
        rCode = in.readInt();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public int getrCode() {
        return rCode;
    }

    public void setrCode(int rCode) {
        this.rCode = rCode;
    }

    public String getrMessage() {
        return rMessage;
    }

    public void setrMessage(String rMessage) {
        this.rMessage = rMessage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(rMessage);
        parcel.writeInt(rCode);
    }
}
